package com.ljph.ljaker.model.ext;

import com.jfinal.plugin.activerecord.IBean;
import com.jfinal.plugin.activerecord.Model;

import java.util.List;

/**
 * 良晋商品库 品牌
 * Created by yuzhou on 16/9/12.
 */
public class ExtBrand extends Model<ExtBrand> implements IBean {

    public static final String TABLE_NAME = "ecs_pr_brand";
    public static final String PRIMARY_KEY = "brand_id";
    public static final String CACHE_NAME = "extBrandCache";
    public static final ExtBrand dao = new ExtBrand();

    public List<ExtBrand> findByType(Object type) {
        return find("select brand_id, brand_name from " + TABLE_NAME + " where type=?", type);
    }

    public Integer getId(){
        return getInt("brand_id");
    }

    public String getName(){
        return get("brand_name");
    }
}
